查看原文
其他

Nacos部署中的几个常见问题

翟永超 程序猿DD 2020-10-16

点击蓝色“程序猿DD”关注我哟

加个“星标”,不忘签到哦





开个帖子,汇总几个读者经常提到的一些问题

问题一:Ubuntu下启动Nacos报错

问题描述

使用命令 sh startup.sh-m standalone启动报错:

  1. ./startup.sh: 78: ./startup.sh: [[: not found

  2. ./startup.sh: 88: ./startup.sh: [[: not found

  3. ./startup.sh: 90: ./startup.sh: [[: not found

  4. ./startup.sh: 96: ./startup.sh: [[: not found

  5. /usr/lib/jvm/java-8-openjdk-amd64/bin/java -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/soft/nacos/logs/java_heapdump.hprof -XX:-UseLargePages -Djava.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/lib/jvm/java-8-openjdk-amd64/lib/ext:/data/soft/nacos/plugins/cmdb:/data/soft/nacos/plugins/mysql -Xloggc:/data/soft/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/data/soft/nacos -jar /data/soft/nacos/target/nacos-server.jar --spring.config.location=classpath:/,classpath:/config/,file:./,file:./config/,file:/data/soft/nacos/conf/ --logging.config=/data/soft/nacos/conf/nacos-logback.xml

  6. ./startup.sh: 116: ./startup.sh: [[: not found

  7. nacos is starting,you can check the /data/nacos/logs/start.out

解决方法

改用命令 bash-f./startup.sh-m standalone启动

问题二:Failed to create database '/data/soft/nacos/data/derby-data'

问题描述

使用命令 sh startup.sh-m standalone启动的时候,出现如下报错:

  1. Caused by: java.lang.RuntimeException: load schema.sql error.org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to create database '/data/nacos/data/derby-data', see the next exception for details.)

  2. at com.alibaba.nacos.config.server.service.LocalDataSourceServiceImpl.reload(LocalDataSourceServiceImpl.java:110)

  3. at com.alibaba.nacos.config.server.service.LocalDataSourceServiceImpl.init(LocalDataSourceServiceImpl.java:94)

  4. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  5. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

  6. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  7. at java.lang.reflect.Method.invoke(Method.java:498)

  8. at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363)

  9. at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307)

  10. at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)

  11. ... 70 common frames omitted

解决方法

删除报错信息中的'/data/nacos/data/derby-data'目录,重新启动。

本文首发于博客:http://blog.didispace.com/nacos-faqs/

欢迎留言补充与交流


推荐阅读


号外:最近整理了之前编写的一系列内容做成了PDF,关注我并回复相应口令获取:

001 :领取《Spring Boot基础教程》

002 :领取《Spring Cloud基础教程》



活动介绍自律到极致-人生才精致:第5期

活动奖励:《微服务架构与实践(第2版)》* 10  

扫描下面二维码签到参与

关注我,加个星标,不忘签到哦~


2019

与大家聊聊技术人的斜杠生活

    您可能也对以下帖子感兴趣

    文章有问题?点此查看未经处理的缓存